home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: mozart.unx.sas.com!jamie
- From: jamie@cdevil.unx.sas.com (James Cooper)
- Subject: Re: SasC linker Error:
- Originator: jamie@cdevil.unx.sas.com
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <DnLo2H.8ur@unx.sas.com>
- Date: Fri, 1 Mar 1996 17:47:05 GMT
- X-Nntp-Posting-Host: cdevil.unx.sas.com
- References: <dkauppDnEzzs.FsD@netcom.com>
- Organization: SAS Institute Inc.
-
-
- In article <dkauppDnEzzs.FsD@netcom.com>, dkaupp@netcom.com (Blitter) writes:
- > Can someone tell me what may be causing these errors? MOBtrigger is a
- >BOOL and as far a I know, its just changed using TRUE and FALSE.
- >
- > If someone can point me in the right direction I would appriciate it :).
- >
- >Thanks.
- >
- ><<start paste>>
- >
- >New Shell process 8
- >8.Boot:> dh0:Programming/Merc22/src/
- >8.Stuff2:Programming/Merc22/src> smake
- >SAS/C_SMAKE 6.55 (17.2.95)
- >Copyright (c) 1988-1995 SAS Institute, Inc.
- > sc link to comm with temp_smk.tmp
- >SAS/C Amiga Compiler 6.56
- >Copyright (c) 1988-1995 SAS Institute Inc.
- >Slink - Version 6.56
- >Copyright (c) 1988-1995 SAS Institute, Inc. All Rights Reserved.
- >
- >ERROR: Multiply defined symbol '_MOBtrigger'.
- > First defined in file 'comm.o'.
- > Type = RELOCATABLE Value = 1010
- > Redefined in file 'special.o'.
- > Type = RELOCATABLE Value = 9
- >
- > [lots more 'Multiply defined symbol' errors...]
- >
- ><<end>>
-
- Looks like you've got a common header file included by all your source
- modules.
-
- In this file, your probably have
-
- BOOL MOBTrigger;
-
- (maybe with initialization).
-
- Well, that's the problem. You've just declared a variable with the same
- name in each of your modules, and the linker is letting you know that
- you have global variables with matching names.
-
- The proper way around this is to declare that variable in the header
- with the 'extern' keyword, as in
-
- extern BOOL MODTrigger;
-
- then in one of your modules, put the actually variable in the .c file
- itself.
-
- --
- ---------------
- Jim Cooper
- (jamie@unx.sas.com) bix: jcooper
-
- Any opinions expressed herein are mine (Mine, all mine! Ha, ha, ha!),
- and not necessarily those of my employer.
-
- I'm NOT Politically Correct, but that's because I'm "Sensitivity Challenged."
-